from case.po.basePage.base_page import BasePage
from selenium import webdriver
from selenium.webdriver.common.by import By

'''
 HTML/cssc帖子列表页面对象
'''
class ArticlePage(BasePage):

    #1. 页面元素
    url="https://afterwin.cn/category/h5"
    article_title=(By.PARTIAL_LINK_TEXTR,"午后万缕阳光照拂了海面")

    #2. 元素的操作流
    def viewArticle(self,time):
        #访问url
        self.visit(self.url)
        #等待
        self.wait(time)
        #点击帖子
        self.click(self.article_title)


if __name__ =="__main__":
    driver =webdriver.Chrome()
    #实例化查看帖子页， 要传入一个driver
    sp = ArticlePage(driver)
    sp.viewArticle(3)
